package TitleScreen;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

/**
 * Sets up the title screen(Login/Registration form)
 * 
 * @return Login/Registration form
 * @author Thomas Felder
 */
public class startComponentPanel extends JPanel {
	// If not specified differently, code by Thomas Felder
	private JLabel lb_registerlogin = new JLabel("Register / Log in");
	private JLabel lb_UserName = new JLabel("Username");
	JTextField txtF_UserName = new JTextField(15);
	private JLabel lb_Password = new JLabel("Password");
	JPasswordField txtF_Password = new JPasswordField(15);

	JButton btn_register = new JButton("Register");
	JButton btn_login = new JButton("Login");

	public startComponentPanel() {

		initComponents();

	}

	public void initComponents() {
		setOpaque(false);
		setLayout(new GridBagLayout());
		initLayout();
		setVisible(true);

	}

	public void initLayout() {

		// Component settings

		// End of Component Settings
		GridBagConstraints gc = new GridBagConstraints();
		gc.insets = new Insets(2, 2, 2, 2);

		gc.gridy = 0; // column
		gc.gridx = 0; // row
		add(lb_registerlogin, gc);

		gc.anchor = GridBagConstraints.FIRST_LINE_START; // allocating the
															// following
															// components to the
															// left side of the
															// GBL

		gc.gridy = 1; // column
		gc.gridx = 0; // row
		add(lb_UserName, gc);

		gc.gridy = 2; // column
		gc.gridx = 0; // row
		add(txtF_UserName, gc);

		gc.gridy = 3; // row
		gc.gridx = 0; // column
		add(lb_Password, gc);

		gc.gridy = 4; // row
		gc.gridx = 0; // column
		add(txtF_Password, gc);

		gc.gridy = 5; // row
		gc.gridx = 0; // column
		add(btn_register, gc);

		gc.anchor = GridBagConstraints.FIRST_LINE_END; // allocating the
														// following component
														// to the right side of
														// the
		gc.gridy = 5; // row
		gc.gridx = 0; // column
		add(btn_login, gc);

	}

	public JTextField getTxtF_UserName() {
		return txtF_UserName;
	}

	public JTextField getTxtF_Password() {
		return txtF_Password;
	}

	public JButton getBtn_register() {
		return btn_register;
	}

	public JButton getBtn_login() {
		return btn_login;
	}

}
